<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Document</title>
</head>
<body>
  <div id="test">
    <h3>{{cont}}</h3>
    <button @click="cont++">点击1</button>
    <button @click="test()">点击2</button>
    <button v-on:click="test1('abc')">1</button>
    <button @click="test2('abc',$event)">2</button>
  </div>

  <script src="../js/vue.js"></script>
  <script>
    new Vue({
      el: "#test",
      data: {
        cont:0
      },
      methods:{
        test(){
            this.cont++
            console.log(this);
        },
        test1(a){
            alert(a)
        },
        test2(a,e){
            alert(a+e.target.innerText)
        }
      }
    })
  </script>
</body>
</html>